package study.datastructure.graph.criticalpath;/**
 * @program: datastructure
 * @author: lcy
 * @create: 2024-06-18 13:16
 */

import java.util.ArrayList;
import java.util.List;

/**
 2024/6/18,
 */


public class Task {
    String name;
    //做任务的时间
    int duration;


    int earliestStart;
    int earliestFinish;
    int latestStart;
    int latestFinish;


    //前驱任务
    List<Task> predecessors;

    public Task( String name,int duration) {
        this.duration = duration;
        this.name = name;
        predecessors=new ArrayList<>();
    }
    public void addPredecessor(Task predecessor){
        predecessors.add(predecessor);
    }

    @Override
    public String toString() {
        return "name='" + name + '\'' +
                ", duration=" + duration +
                ", earliestStart=" + earliestStart +
                ", earliestFinish=" + earliestFinish +
                ", latestStart=" + latestStart +
                ", latestFinish=" + latestFinish +
                ", predecessors=" + predecessors;
    }
}
